package com.bytz.modules.system.controller;

import com.bytz.common.api.vo.Result;
import com.bytz.modules.cms.common.model.CmsConfig;
import com.bytz.modules.cms.common.service.CmsConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sys/config")
@Api(tags = "系统参数管理")
public class SysConfigController {

    @Autowired
    private CmsConfigService cmsConfigService;


    @ApiOperation("获取系统全局参数")
    @GetMapping("/global")
    public Result<CmsConfig> getGlobalConfig() {
        return Result.ok(cmsConfigService.getGlobal());
    }
}
